package com.cx.dubbo.utils;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.lang.exception.NestableRuntimeException;

public class PropertiesUtil {

private static Configuration config ; 
	
	static{
		try {
			config = new PropertiesConfiguration("config.properties");
			
		} catch (NestableRuntimeException e2) {
			e2.printStackTrace();
		} catch (ConfigurationException e3) {
			e3.printStackTrace();
		}
	}
	
	public static Configuration getConfig(){
		if(config == null){
			try {
				config =  new PropertiesConfiguration("common.properties");
			} catch (NestableRuntimeException e2) {
				e2.printStackTrace();
			} catch (ConfigurationException e3) {
				e3.printStackTrace();
			}
		}
		return config;
	}
}
